home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / dtype / mndtv394.lha / mandt / s / man
AmigaDOS Script File  |  1994-11-30  |  1KB  |  65 lines

  1. .key file/a,section
  2. .bra {
  3. .ket }
  4.  
  5. ;
  6. ; $PROJECT: unix manual page CLI command using MultiView and man.datatype
  7. ;
  8. ; $VER: man 1.2 (19.11.94)
  9. ; by
  10. ;
  11. ; Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  12. ;
  13. ; (C) Copyright 1994
  14. ; All Rights Reserved !
  15. ;
  16. ; $FUNCTION:
  17. ;
  18. ; This command searches for a given string and if it found a entry, it opens
  19. ; a MultiView window to display it (The man.datatype have to be installed) !
  20. ;
  21. ; Set the MANPATH environment variable to the root directory for the man pages.
  22. ;
  23. ;
  24. ; $HISTORY:
  25. ;
  26. ; 19.11.94 : 001.002 :  now uses [0-9] pattern as suffix
  27. ; 18.11.94 : 001.001 :  initial
  28. ;
  29.  
  30. ; use this, if the mandb entries are relativ path's
  31. set MPATH $MANPATH/
  32. ; use this, if the mandb entries are global path's
  33. ; set MPATH ""
  34.  
  35. if NOT EXISTS $MANPATH/mandb
  36.    search $MANPATH #?.[0-9] FILE ALL >$MANPATH/mandb
  37. endif
  38.  
  39. if NOT EXISTS $MANPATH/mandb
  40.    Echo "Can't find man database !"
  41.    quit 5
  42. endif
  43.  
  44. if NOT "{section}" EQ ""
  45.    search $MANPATH/mandb #?{section}/{file}.[0-9] PATTERN NONUM >ENV:MAN
  46.    if "$MAN" EQ ""
  47.       Echo "no manual entry in section {section} found !"
  48.    endif
  49. else
  50.    search $MANPATH/mandb /{file}.[0-9] PATTERN NONUM >ENV:MAN
  51.    if "$MAN" EQ ""
  52.       Echo "no manual entry found !"
  53.    endif
  54. endif
  55.  
  56. ; if something is found , display it via MultiView
  57. if NOT "$MAN" EQ ""
  58.    run >NIL: <NIL: multiview $MPATH$MAN PUBSCREEN `GetPubName`
  59. endif
  60.  
  61. ; cleanup
  62. unsetenv MAN
  63. unset MPATH
  64.  
  65.